package com.cn.algorithm01;

/**
 * @author hels
 * @version 1.0
 * @date 2021/9/30 14:20
 */
public class Code01 {

    public static void print(int num) {
        for (int i = 31; i >= 0; i-- ) {
            System.out.print((num & (1 << i)) == 0 ? "0" : "1");
        }
        System.out.println();
    }

    public static void main(String[] args) {

        // print(2048);
        // print(-204800000);
        System.out.println(Integer.MIN_VALUE);
        System.out.println(Integer.MAX_VALUE);
        print(-1024);
        print(-1024 << 1);
        print(-8);  // 负数在计算机中表示，除符号位的原码取反后加1；
        print(8);

    }
}
